package algorithm;

/**
 * @description: 线性查找
 * @author: apple
 * @date:  2021/11/17 10:56 下午
 * @version 1.0
 **/
public class SequentialSearch {

    public static void main(String[] args) {

        String[] tx = {"A" , "B" , "C"};
        boolean flag = false;
        String t = "B";
        for (int i = 0; i < tx.length; i++) {
            if (tx[i].equals(t)) {
                flag = true;
                break;
            }
        }

        if (flag) {
            System.out.println("找到了");
        } else {
            System.out.println("没有找到");
        }
    }
}
